home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / news / transport / cnews / patches / CR.E < prev    next >
Encoding:
Text File  |  1995-01-03  |  29.6 KB  |  1,161 lines

  1. Newsgroups: news.software.b
  2. Subject: C News patch CR.E
  3.  
  4. This is a patch for the C News Cleanup Release.  The distribution files
  5. on ftp.cs.toronto.edu and zoo.toronto.edu have been updated to match.
  6. See the README.changes diff below for what's been done.
  7.  
  8. start of patch CR.E
  9. (suggested archive name:  patchCR.E)
  10. apply with   patch -p0 <thisfile
  11.  
  12. Prereq: CR.D
  13. *** README.mastercopy    Mon Jan  2 16:31:19 1995
  14. --- README    Thu Dec 29 19:42:51 1994
  15. ***************
  16. *** 1,4 ****
  17. ! Cleanup Release of C News, with patch CR.D            Nov 1994
  18.   
  19.   The current C News distribution can be retrieved by anonymous FTP from
  20.   ftp.cs.toronto.edu (file pub/c-news/c-news.tar.Z) or ftp.zoo.toronto.edu
  21. --- 1,4 ----
  22. ! Cleanup Release of C News, with patch CR.E            Jan 1995
  23.   
  24.   The current C News distribution can be retrieved by anonymous FTP from
  25.   ftp.cs.toronto.edu (file pub/c-news/c-news.tar.Z) or ftp.zoo.toronto.edu
  26.  
  27.  
  28.  
  29. *** README.changes.mastercopy    Mon Jan  2 16:31:20 1995
  30. --- README.changes    Thu Dec 29 18:23:41 1994
  31. ***************
  32. *** 1,3 ****
  33. --- 1,19 ----
  34. + High points of patch CR.E:
  35. + This one is mostly fairly minor things.  The big changes are further work
  36. + on upact, to remove a race condition that would sometimes update the min
  37. + number incorrectly for low-traffic newsgroups, and revisions to inews's
  38. + interior to remove ersh and thus the last invocation of rsh, at the expense
  39. + of building somewhat longer message IDs when posting on a server from a
  40. + client.  Histinfo (used in mkhistory etc.) now ignores nonexistent articles
  41. + rather than croaking on them.  The newsflag command is now documented.  The
  42. + configuration setup used for regression tests has been revised to ignore
  43. + any NEWSCTL (etc.) environment variables that you may happen to have
  44. + in your environment (which may be right for production use, but are most
  45. + definitely wrong for the regression tests, which want to supply their own).
  46. + Quiz no longer offers to fake link(), which can't be done without breaking
  47. + the locking protocol (oops).  The expovguts messages have been improved.
  48. + More portability work in dostatfs.  And the usual minor fixes.
  49.   High points of patch CR.D:
  50.   This one's mostly a cleanup job on CR.B/CR.C.  The one really new item
  51.   is a queuelen appropriate to Taylor UUCP.  The master makefile has been
  52.  
  53.  
  54.  
  55. *** quiz.mastercopy    Mon Jan  2 16:31:20 1995
  56. --- quiz    Thu Dec  1 13:06:16 1994
  57. ***************
  58. *** 171,177 ****
  59.   possibly-missing system calls, but it needs to know which are missing.
  60.   !
  61.   newfake=
  62. ! mightfake='fcntl fgetline getopt gettimeofday link memcpy mkdir putenv
  63.       remove rename strchr strerror strspn symlink'
  64.   for fn in $mightfake
  65.   do
  66. --- 171,177 ----
  67.   possibly-missing system calls, but it needs to know which are missing.
  68.   !
  69.   newfake=
  70. ! mightfake='fcntl fgetline getopt gettimeofday memcpy mkdir putenv
  71.       remove rename strchr strerror strspn symlink'
  72.   for fn in $mightfake
  73.   do
  74. ***************
  75. *** 403,409 ****
  76.   do
  77.       uucptype=`$ask 'Which one is most appropriate' ${uucptype-hdb}`
  78.       case "$uucptype" in
  79. !     svr4|hdb|tay|sub|old|pre|null)    break    ;;
  80.       esac
  81.       echo 'Sorry, no such choice is available.'
  82.   done
  83. --- 403,409 ----
  84.   do
  85.       uucptype=`$ask 'Which one is most appropriate' ${uucptype-hdb}`
  86.       case "$uucptype" in
  87. !     svr4|hdb|tay|sub|vo|pre|null)    break    ;;
  88.       esac
  89.       echo 'Sorry, no such choice is available.'
  90.   done
  91.  
  92.  
  93.  
  94. *** conf/README.mastercopy    Mon Jan  2 16:31:21 1995
  95. --- conf/README    Thu Dec 29 16:10:02 1994
  96. ***************
  97. *** 1,10 ****
  98. ! This is C News master configuration stuff, including some auxiliary C News
  99. ! programs that are quite likely to need site-specific customizing, and some
  100. ! odds and ends of maintenance stuff that didn't fit anywhere else.
  101.   
  102. ! Subst may possibly be useful enough to deserve installation as a program
  103. ! in its own right, which is why a manual page is supplied.
  104. ! "build" is the all-singing-all-dancing interactive shell program that sets
  105. ! up a bunch of shell files for you to run to install everything.  "build"
  106. ! itself does not mess with anything, so it can be run without danger.
  107. --- 1,32 ----
  108. ! This is configuration files and miscellaneous oddments that don't fit
  109. ! in any of the subsystems.
  110.   
  111. ! active.eg    sample active file
  112. ! ask        question-asker auxiliary for quiz
  113. ! checkfile    ownership/permission checker for make cmp
  114. ! cmpto        file comparer for make cmp
  115. ! config        sample config file
  116. ! cpto        file copier for installation
  117. ! cron.proto    prototype file from which sample crontab is generated
  118. ! deadfiles    list of files obsoleted by new releases of C News
  119. ! inall        do-command-in-all-directories auxiliary for top-level makefile
  120. ! libcmp        library-member comparer for make cmp
  121. ! mailname.eg    sample mailname file
  122. ! mailpaths.eg    sample mailpaths file
  123. ! makefilelist    list of makefiles for subst
  124. ! maker        make-with-include imitation
  125. ! mkdirs        directory maker for installation
  126. ! notinlist    list-checker auxiliary for quiz
  127. ! organization    sample organization file
  128. ! rconfig        regression-test config file
  129. ! rsetup        regression-test setup script
  130. ! subst        substituter
  131. ! subst.1        manpage for subst
  132. ! subst.all    list of all non-makefile files to be subst'ed
  133. ! sys.eg        sample sys file
  134. ! update.ran    ranlib version of library updater for make
  135. ! update.sym    symdef version of library updater for make
  136. ! useanswers    file-generator auxiliary for quiz
  137. ! versionname    version name of C News
  138. ! whoami.eg    sample whoami file
  139. ! yesno        question-asker auxiliary for quiz
  140.  
  141.  
  142.  
  143. *** conf/versionname.mastercopy    Mon Jan  2 16:31:21 1995
  144. --- conf/versionname    Thu Dec 29 17:14:58 1994
  145. ***************
  146. *** 1 ****
  147. ! Cleanup Release, with patch CR.D
  148. --- 1 ----
  149. ! Cleanup Release, with patch CR.E
  150.  
  151.  
  152.  
  153. *** conf/rsetup.mastercopy    Mon Jan  2 16:31:22 1995
  154. --- conf/rsetup    Thu Dec 29 15:39:59 1994
  155. ***************
  156. *** 0 ****
  157. --- 1,20 ----
  158. + # variable setup for regression tests
  159. + # This one overrides incoming values, which may not be right for testing,
  160. + # and exports the new values so rconfig will see them and defer to them.
  161. + #
  162. + NEWSCTL=`pwd`
  163. + NEWSBIN=`pwd`
  164. + NEWSARTS=`pwd`/arts
  165. + NEWSOV=$NEWSARTS
  166. + # =()<NEWSPATH=@<NEWSPATH>@>()=
  167. + NEWSPATH=/bin:/usr/bin:/usr/contrib/bin
  168. + NEWSUMASK=022
  169. + NEWSCONFIG=`pwd`/../conf/rconfig
  170. + LOGNAME=regression
  171. + export NEWSCTL NEWSBIN NEWSARTS NEWSOV NEWSPATH NEWSUMASK NEWSCONFIG LOGNAME
  172.  
  173.  
  174.  
  175. *** conf/useanswers.mastercopy    Mon Jan  2 16:31:22 1995
  176. --- conf/useanswers    Thu Dec 29 15:47:36 1994
  177. ***************
  178. *** 162,168 ****
  179.       echo "URGENTTO=$newscrisis"
  180.       echo
  181.       echo "# things for testing"
  182. !     echo "HERE=. ../conf/config.r ;"
  183.       echo
  184.       echo "# fake files needed"
  185.       echo "HFAKE=$fakehdrs"
  186. --- 162,168 ----
  187.       echo "URGENTTO=$newscrisis"
  188.       echo
  189.       echo "# things for testing"
  190. !     echo "HERE=. ../conf/rsetup ;"
  191.       echo
  192.       echo "# fake files needed"
  193.       echo "HFAKE=$fakehdrs"
  194.  
  195.  
  196.  
  197. *** conf/deadfiles.mastercopy    Mon Jan  2 16:31:23 1995
  198. --- conf/deadfiles    Mon Jan  2 16:26:16 1995
  199. ***************
  200. *** 1,4 ****
  201. --- 1,9 ----
  202. + conf/config.r
  203. + conf/substs
  204. + conf/libcheck
  205.   doc/flow.old
  206.   expire/mkadir
  207. + inject/ersh
  208. + libfake/link.c
  209.   util/queuelen.old
  210.   README.old
  211.  
  212.  
  213.  
  214. *** conf/subst.all.mastercopy    Mon Jan  2 16:31:23 1995
  215. --- conf/subst.all    Thu Dec 29 17:17:31 1994
  216. ***************
  217. *** 9,16 ****
  218.   batch/usenntpxmit
  219.   batch/viainews
  220.   conf/config
  221. - conf/config.r
  222.   conf/cron.proto
  223.   contrib/snntp/snntpsend
  224.   ctl/checkgroups
  225.   ctl/delsendsys
  226. --- 9,17 ----
  227.   batch/usenntpxmit
  228.   batch/viainews
  229.   conf/config
  230.   conf/cron.proto
  231. + conf/rconfig
  232. + conf/rsetup
  233.   contrib/snntp/snntpsend
  234.   ctl/checkgroups
  235.   ctl/delsendsys
  236. ***************
  237. *** 73,78 ****
  238. --- 74,80 ----
  239.   man/newsbatch.8cn
  240.   man/newsctl.5
  241.   man/newsdb.5
  242. + man/newsflag.8cn
  243.   man/newsmail.8cn
  244.   man/newsmaint.8cn
  245.   man/newsoverview.5
  246.  
  247.  
  248.  
  249. *** conf/makefile.mastercopy    Mon Jan  2 16:31:24 1995
  250. --- conf/makefile    Thu Dec 29 18:26:35 1994
  251. ***************
  252. *** 51,58 ****
  253.       test -d $(NEWSARTS)/$(LASTGROUP) -a -d $(NEWSOV)/$(LASTGROUP) ;
  254.   
  255.   mx:
  256. !     $(MX) checkfile cmpto config.r cpto inall libcheck libcmp maker
  257. !     $(MX) mkdirs subst update.*
  258.   
  259.   active.times:    active.eg
  260.       sed 's/ .*/ 0 unknown/' active.eg >$@
  261. --- 51,58 ----
  262.       test -d $(NEWSARTS)/$(LASTGROUP) -a -d $(NEWSOV)/$(LASTGROUP) ;
  263.   
  264.   mx:
  265. !     $(MX) checkfile cmpto cpto inall libcmp maker
  266. !     $(MX) mkdirs rconfig rsetup subst update.*
  267.   
  268.   active.times:    active.eg
  269.       sed 's/ .*/ 0 unknown/' active.eg >$@
  270.  
  271.  
  272.  
  273. *** conf/rconfig.mastercopy    Mon Jan  2 16:31:24 1995
  274. --- conf/rconfig    Thu Dec 29 15:40:07 1994
  275. ***************
  276. *** 0 ****
  277. --- 1,18 ----
  278. + # fake configuration for regression tests
  279. + # should be used only in conjunction with rsetup
  280. + #
  281. + NEWSCTL=${NEWSCTL-`pwd`}
  282. + NEWSBIN=${NEWSBIN-`pwd`}
  283. + NEWSARTS=${NEWSARTS-`pwd`/arts}
  284. + NEWSOV=$NEWSARTS
  285. + # =()<NEWSPATH=${NEWSPATH-@<NEWSPATH>@}>()=
  286. + NEWSPATH=${NEWSPATH-/bin:/usr/bin:/usr/contrib/bin}
  287. + NEWSUMASK=${NEWSUMASK-022}
  288. + NEWSCONFIG=${NEWSCONFIG-`pwd`/../conf/rconfig}
  289. + LOGNAME=${LOGNAME-regression}
  290.  
  291.  
  292.  
  293. *** doc/problems.mastercopy    Mon Jan  2 16:31:25 1995
  294. --- doc/problems    Tue Dec  6 22:37:18 1994
  295. ***************
  296. *** 1106,1109 ****
  297.   .DS
  298.   ftp://ftp.cim.mcgill.ca/pub/people/steve/pc/linux/join
  299.   .DE
  300. ! Textutils 1.11 reportedly has fixed this.
  301. --- 1106,1113 ----
  302.   .DS
  303.   ftp://ftp.cim.mcgill.ca/pub/people/steve/pc/linux/join
  304.   .DE
  305. ! Textutils 1.11 has fixed this.
  306. ! Unfortunately, it has introduced a new and different bug that
  307. ! makes the
  308. ! .I mergeactive
  309. ! regression test fail...
  310.  
  311.  
  312.  
  313. *** expire/upact.mastercopy    Mon Jan  2 17:47:17 1995
  314. --- expire/upact    Mon Jan  2 17:47:57 1995
  315. ***************
  316. *** 12,28 ****
  317.   umask $NEWSUMASK
  318.   
  319.   maxlen=200            # max length for shell cmd; 200 is pretty safe
  320. - mindirs=2            # minimum # dirs for ls -f
  321.   replace=yes
  322.   what=normal            # update min, make sure max has a 0 on front
  323.   lserr=/dev/null
  324.   for dummy
  325.   do
  326.       case "$1" in
  327.       -b)    what=both    ;;    # update both max and min
  328.       -p)    what=plain    ;;    # don't do ANYTHING to max
  329. !     -s)    maxlen=0 ; mindirs=1    ;;    # ls is funny, do slow way
  330.       '-#')    replace=no ; lserr=$NEWSCTL/active.errs    ;;    # debugging
  331.       --)    shift ; break    ;;
  332.       -*)    echo "$0: unknown option \`$1'" >&2 ; exit 2    ;;
  333.       *)    break        ;;
  334. --- 12,29 ----
  335.   umask $NEWSUMASK
  336.   
  337.   maxlen=200            # max length for shell cmd; 200 is pretty safe
  338.   replace=yes
  339.   what=normal            # update min, make sure max has a 0 on front
  340.   lserr=/dev/null
  341. + interpose=
  342.   for dummy
  343.   do
  344.       case "$1" in
  345.       -b)    what=both    ;;    # update both max and min
  346.       -p)    what=plain    ;;    # don't do ANYTHING to max
  347. !     -s)    maxlen=0    ;;    # ls is funny, do slow way
  348.       '-#')    replace=no ; lserr=$NEWSCTL/active.errs    ;;    # debugging
  349. +     -I)    interpose="$2" ; shift ;;    # interpose pgm for testing
  350.       --)    shift ; break    ;;
  351.       -*)    echo "$0: unknown option \`$1'" >&2 ; exit 2    ;;
  352.       *)    break        ;;
  353. ***************
  354. *** 32,49 ****
  355.   
  356.   cd $NEWSCTL
  357.   
  358.   # check out the active file
  359. ! checkactive -n -q >active.eek
  360.   if test -s active.eek
  361.   then
  362.       echo "$0: problems in active file -- aborting" >&2
  363.       cat active.eek >&2
  364. !     rm -f active.eek
  365. !     exit 1
  366. ! fi
  367. ! if test " `awk '{print $1}' active | sort | uniq -d`" != " "
  368. ! then
  369. !     echo "$0: duplicate newsgroups in active file, unable to run" >&2
  370.       exit 1
  371.   fi
  372.   
  373. --- 33,53 ----
  374.   
  375.   cd $NEWSCTL
  376.   
  377. + # lock news system momentarily and grab a copy of the active file
  378. + lock LOCK $$ || exit 1
  379. + status=1
  380. + trap 'unlock LOCK ; trap 0 ; exit $status' 0 1 2 15
  381. + sort active >active.upact || exit    # sort brings related dirs together
  382. + trap 0 1 2 15
  383. + unlock LOCK
  384.   # check out the active file
  385. ! checkactive -n -q active.upact >active.eek
  386.   if test -s active.eek
  387.   then
  388.       echo "$0: problems in active file -- aborting" >&2
  389.       cat active.eek >&2
  390. !     rm -f active.eek active.upact
  391.       exit 1
  392.   fi
  393.   
  394. ***************
  395. *** 52,69 ****
  396.   # rather different from his.  Thanks, Bernd!
  397.   
  398.   # first, find minima, efficiently
  399. ! # translate names to dirs, sort to bring related ones together (to exploit
  400. ! # any kernel caching), turn dirs into "ls -f" commands, run them, pick
  401. ! # the desired data out of the output, turn dirs back into names, and
  402. ! # sort for input to join
  403. ! tr '.' '/' <active | sort |
  404.       awk 'BEGIN {
  405.           maxlen = '"$maxlen"'
  406. -         mindirs = '"$mindirs"'
  407.           dirs = ""
  408.           ndirs = 0
  409.       }
  410. !     length($1) + length(dirs) > maxlen && ndirs >= mindirs {
  411.           if (ndirs == 1)
  412.               print "echo " substr(dirs, 2) ":"
  413.           print "ls -f" dirs
  414. --- 56,72 ----
  415.   # rather different from his.  Thanks, Bernd!
  416.   
  417.   # first, find minima, efficiently
  418. ! # translate names to dirs, turn dirs into "ls -f" commands, run them, pick
  419. ! # the desired data out of the output, turn dirs back into names, sort again,
  420. ! # and merge in old-max values
  421. ! tr '.' '/' <active.upact |
  422.       awk 'BEGIN {
  423.           maxlen = '"$maxlen"'
  424.           dirs = ""
  425.           ndirs = 0
  426. +         print "cd '"$NEWSARTS"'"
  427.       }
  428. !     length($1) + length(dirs) > maxlen && ndirs > 0 {
  429.           if (ndirs == 1)
  430.               print "echo " substr(dirs, 2) ":"
  431.           print "ls -f" dirs
  432. ***************
  433. *** 77,83 ****
  434.               print "echo " substr(dirs, 2) ":"
  435.           print "ls -f" dirs
  436.           print "echo /.:"        # simplifies later logic
  437. !     }' | ( cd $NEWSARTS ; sh 2>$lserr ) |
  438.       awk -F' ' 'BEGIN {
  439.           OFMT = "%.12g"
  440.           big = 99999999999
  441. --- 80,86 ----
  442.               print "echo " substr(dirs, 2) ":"
  443.           print "ls -f" dirs
  444.           print "echo /.:"        # simplifies later logic
  445. !     }' | sh 2>$lserr |
  446.       awk -F' ' 'BEGIN {
  447.           OFMT = "%.12g"
  448.           big = 99999999999
  449. ***************
  450. *** 95,120 ****
  451.           next
  452.       }
  453.       $0 ~ /\/\.:$/ {
  454. !         if (dir != "" && highest != small)
  455. !             print dir, highest, lowest
  456.           dir = substr($0, 1, length($0)-3)    # trim off /.:
  457.           lowest = big
  458.           highest = small
  459. !     }' | tr '/' '.' | sort >active.lows
  460.   
  461. ! # lock news system
  462.   lock LOCK $$ || exit 1
  463.   status=1
  464.   trap 'unlock LOCK ; trap 0 ; exit $status' 0 1 2 15
  465.   
  466. ! # combine results with active file, carefully
  467.   extra=
  468.   case "$what" in
  469. ! both)    extra='$6 != "-" && $6 > $3 {
  470. !         s = "000000000000000" $6
  471.           len = length($3)
  472. !         if (length($6) > len)
  473. !             len = length($6) + 1
  474.           s = substr(s, length(s)-len+1)
  475.           if (s !~ /^0/)
  476.               s = "0" s
  477. --- 98,136 ----
  478.           next
  479.       }
  480.       $0 ~ /\/\.:$/ {
  481. !         if (dir != "") {
  482. !             if (highest != small)
  483. !                 print dir, highest, lowest
  484. !             else
  485. !                 print dir, "-", "-"
  486. !         }
  487.           dir = substr($0, 1, length($0)-3)    # trim off /.:
  488.           lowest = big
  489.           highest = small
  490. !     }' | tr '/' '.' | sort |
  491. !     join -o 1.1 2.2 1.2 1.3 - active.upact >active.hilow
  492. ! # active.hilow now is newsgroup, old max, high file, low file
  493. ! # testing hook
  494. ! if test " $interpose" != " "
  495. ! then
  496. !     $interpose
  497. ! fi
  498.   
  499. ! # lock news system again
  500.   lock LOCK $$ || exit 1
  501.   status=1
  502.   trap 'unlock LOCK ; trap 0 ; exit $status' 0 1 2 15
  503.   
  504. ! # decide on any extra processing needed
  505.   extra=
  506.   case "$what" in
  507. ! both)    extra='$7 != "-" && $7 > $3 {
  508. !         # update max from high file
  509. !         s = "000000000000000" $7
  510.           len = length($3)
  511. !         if (length($7) > len)
  512. !             len = length($7) + 1
  513.           s = substr(s, length(s)-len+1)
  514.           if (s !~ /^0/)
  515.               s = "0" s
  516. ***************
  517. *** 123,144 ****
  518.       ;;
  519.   normal)    extra='$3 !~ /^0/ { $3 = "0" $3 }'    ;;
  520.   esac
  521.   awk '{ print $1, $2, $3, $4, NR }' active | sort |
  522. !     join -a1 -e - -o 1.5 1.1 1.2 1.3 1.4 2.2 2.3 - active.lows |
  523.       sort -n |
  524.       awk 'BEGIN { OFMT = "%.12g" }
  525.       $1 == "-" { next }        # no longer in active file
  526.       '"$extra"'
  527.       {
  528. !         if ($7 == "-" || $7 == "")
  529. !             s = $3 + 1
  530. !         else
  531. !             s = $7
  532.           if (length(s) < 5) {
  533.               s = "00000" s
  534.               s = substr(s, length(s)-5+1)
  535.           }
  536. !         print $2, ($3 ""), s, $5
  537.       }' >active.tmp
  538.   
  539.   # check that everything looks okay
  540. --- 139,169 ----
  541.       ;;
  542.   normal)    extra='$3 !~ /^0/ { $3 = "0" $3 }'    ;;
  543.   esac
  544. + # build new active file, cautiously
  545. + # The result of the join is line number (for the sort -n that restores the
  546. + # old order of the active file), newsgroup, active max, active min, active
  547. + # flags, old max, high file, low file.
  548.   awk '{ print $1, $2, $3, $4, NR }' active | sort |
  549. !     join -a1 -e - -o 1.5 1.1 1.2 1.3 1.4 2.2 2.3 2.4 - active.hilow |
  550.       sort -n |
  551.       awk 'BEGIN { OFMT = "%.12g" }
  552.       $1 == "-" { next }        # no longer in active file
  553.       '"$extra"'
  554.       {
  555. !         # find a new value for min
  556. !         if ($8 != "-" && $8 != "")    # there was a low file
  557. !             s = $8            # use it
  558. !         else if ($6+0 != $3+0)        # oldmax != newmax, race cond!
  559. !             s = $4            # use old value to be safe
  560. !         else                # no files and no race
  561. !             s = $3 + 1        # use max+1
  562.           if (length(s) < 5) {
  563.               s = "00000" s
  564.               s = substr(s, length(s)-5+1)
  565.           }
  566. !         print $2, ($3 ""), s, $5    # the "" forces string version
  567.       }' >active.tmp
  568.   
  569.   # check that everything looks okay
  570. ***************
  571. *** 154,161 ****
  572.       echo "$0: active.tmp is bad (short) -- aborting" >&2
  573.       exit            # with status=1
  574.   fi
  575. ! rm -f active.eek active.lows
  576.   
  577.   case "$replace" in
  578.   no)    status=0 ; exit    ;;
  579.   esac
  580. --- 179,187 ----
  581.       echo "$0: active.tmp is bad (short) -- aborting" >&2
  582.       exit            # with status=1
  583.   fi
  584. ! rm -f active.eek active.hilow active.upact    # clean up temporaries
  585.   
  586. + # if we weren't asked to install it, don't
  587.   case "$replace" in
  588.   no)    status=0 ; exit    ;;
  589.   esac
  590.  
  591.  
  592.  
  593. *** expire/makefile.mastercopy    Mon Jan  2 17:36:16 1995
  594. --- expire/makefile    Mon Jan  2 17:31:17 1995
  595. ***************
  596. *** 111,117 ****
  597.       echo 'mod.unmod 00016 00001 y' >>active
  598.       echo 'mod.unmod 00016 00016 y' >>active.after
  599.       echo 'bletch 00099 00001 y' >>active
  600. !     echo 'bletch 00099 00100 y' >>active.after
  601.       cat $(AB) >>active
  602.       cat $(AB) >>active.after
  603.       echo nevermore >arts/lost+found/1
  604. --- 111,117 ----
  605.       echo 'mod.unmod 00016 00001 y' >>active
  606.       echo 'mod.unmod 00016 00016 y' >>active.after
  607.       echo 'bletch 00099 00001 y' >>active
  608. !     echo 'bletch 00100 00001 y' >>active.after
  609.       cat $(AB) >>active
  610.       cat $(AB) >>active.after
  611.       echo nevermore >arts/lost+found/1
  612. ***************
  613. *** 218,240 ****
  614.       test -f arch2/bar/99 ;
  615.       test ! -f arts/urp/99 ;
  616.       cmp history history.after
  617.       : "that's it for expire, on to upact"
  618. !     $(HERE) ./upact $(UPACTOPT) '-#'
  619. !     cmp active.after active.tmp || diff active.after active.tmp
  620.       test ! -s active.errs ;
  621.       mv active.tmp active
  622.       $(HERE) ./upact $(UPACTOPT)
  623. !     cmp active.after active || diff active.after active
  624. !     sed '/^foo /s/103/009/' active.after >active
  625.       $(HERE) ./upact -b $(UPACTOPT)
  626. !     cmp active.after active || diff active.after active
  627.       : "success!"
  628.   
  629.   rclean:
  630.       rm -f junk history history.pag history.dir history.o active active.tmp
  631.       rm -f history.n* *mon.out history.proto history.after test.out doit
  632. !     rm -f active.old active.new explist.reg lint active.after test.stderr
  633. !     rm -f active.errs explist.regw $(BARFS) canonsys.awk namecheck.awk sys
  634.       rm -rf arts arch arch2 arch3 bin
  635.   
  636.   clean:    rclean
  637. --- 218,247 ----
  638.       test -f arch2/bar/99 ;
  639.       test ! -f arts/urp/99 ;
  640.       cmp history history.after
  641. +     test -s history.dir ;
  642. +     test -s history.pag ;
  643.       : "that's it for expire, on to upact"
  644. !     echo "sed '/bletch/s/099/100/' active >active.up" >junk
  645. !     echo "mv active.up active" >>junk
  646. !     $(MX) junk
  647. !     $(HERE) ./upact $(UPACTOPT) -I `pwd`/junk '-#'
  648.       test ! -s active.errs ;
  649. +     cmp active.after active.tmp || diff active.after active.tmp
  650.       mv active.tmp active
  651. +     sed '/bletch/s/001 /101 /' active.after >active.after2
  652.       $(HERE) ./upact $(UPACTOPT)
  653. !     cmp active.after2 active || diff active.after2 active
  654. !     sed '/^foo /s/103/009/' active.after2 >active
  655.       $(HERE) ./upact -b $(UPACTOPT)
  656. !     cmp active.after2 active || diff active.after2 active
  657.       : "success!"
  658.   
  659.   rclean:
  660.       rm -f junk history history.pag history.dir history.o active active.tmp
  661.       rm -f history.n* *mon.out history.proto history.after test.out doit
  662. !     rm -f active.old active.new explist.reg lint active.after* test.stderr
  663. !     rm -f active.errs explist.regw $(BARFS)
  664. !     rm -f canonsys.awk namecheck.awk sys L*
  665.       rm -rf arts arch arch2 arch3 bin
  666.   
  667.   clean:    rclean
  668.  
  669.  
  670.  
  671. *** inject/defaults.c.mastercopy    Mon Jan  2 16:31:27 1995
  672. --- inject/defaults.c    Thu Dec 29 21:59:56 1994
  673. ***************
  674. *** 32,37 ****
  675. --- 32,40 ----
  676.   int usggcos;            /* strictly speaking, "BTL RJE format" */
  677.   time_t now;
  678.   long pid;
  679. + char *server = NULL;
  680. + char *client = NULL;
  681. + size_t ntrimmed = 0;        /* number of chars trimmed off client */
  682.   
  683.   /*
  684.    * main - parse arguments and handle options
  685. ***************
  686. *** 44,50 ****
  687.   
  688.       if (argc > 0)
  689.           progname = argv[0];
  690. !     while ((c = getopt(argc, argv, "dp:t:u")) != EOF)
  691.           switch (c) {
  692.           case 'd':
  693.               ++debug;
  694. --- 47,53 ----
  695.   
  696.       if (argc > 0)
  697.           progname = argv[0];
  698. !     while ((c = getopt(argc, argv, "dp:t:c:s:u")) != EOF)
  699.           switch (c) {
  700.           case 'd':
  701.               ++debug;
  702. ***************
  703. *** 55,60 ****
  704. --- 58,69 ----
  705.           case 't':
  706.               now = atol(optarg);
  707.               break;
  708. +         case 'c':
  709. +             client = optarg;
  710. +             break;
  711. +         case 's':
  712. +             server = optarg;
  713. +             break;
  714.           case 'u':
  715.               usggcos++;
  716.               break;
  717. ***************
  718. *** 68,77 ****
  719. --- 77,113 ----
  720.           exit(2);
  721.       }
  722.   
  723. +     if (client != NULL && server != NULL)
  724. +         trimclient();
  725.       getdefaults();
  726.       exit(0);
  727.   }
  728.   
  729. + /*
  730. +  - trimclient - null out (in client) common suffix of client and server
  731. +  * length of suffix left in ntrimmed
  732. +  */
  733. + trimclient()
  734. + {
  735. +     register size_t clen = strlen(client);
  736. +     register char *c = client + clen;
  737. +     register char *s = server + strlen(server);
  738. +     for (; *c == *s && c > client && s > server; c--, s--)
  739. +         continue;
  740. +     if (*c != *s)
  741. +         c++;        /* c -> last identical char */
  742. +     else if (c > client && s == server && *(c-1) == '.')
  743. +         c--;        /* server name considered to have . on front */
  744. +     if (c > client && *(c-1) == '.') {
  745. +         /* must not end with . */
  746. +         while (*(c-1) == '.' && *c != '\0')
  747. +             c++;
  748. +     }
  749. +     *c = '\0';
  750. +     ntrimmed = clen - (c - client);
  751. + }
  752.   getdefaults()
  753.   {
  754.       register char *name, *domainsuf, *org;
  755. ***************
  756. *** 97,102 ****
  757. --- 133,146 ----
  758.       intcode(now == 0? time(&now): now);
  759.       (void) putchar('.');
  760.       intcode((time_t)(pid == 0? getpid(): pid));
  761. +     if (client != NULL) {
  762. +         (void) putchar('.');
  763. +         intcode((time_t)ntrimmed);
  764. +         if (*client != '\0') {
  765. +             (void) putchar('.');
  766. +             (void) fputs(client, stdout);
  767. +         }
  768. +     }
  769.       (void) fputs(domainsuf, stdout);
  770.       (void) putchar('>');
  771.   
  772.  
  773.  
  774.  
  775. *** inject/pnews.mastercopy    Mon Jan  2 16:31:27 1995
  776. --- inject/pnews    Thu Dec 29 21:36:12 1994
  777. ***************
  778. *** 39,59 ****
  779.   if tear $prefix &&    # output in $inhdrs and $inbody ** takes 0.4 seconds
  780.       canonhdr -dm <$inhdrs >$hdrs    # dredge up defaults ** takes 0.1 secs
  781.   then
  782. !     # get time & pid from the server
  783. !     server="` cat $NEWSCTL/server 2>/dev/null `"
  784. !     case "$server" in
  785. !     "")    me="$server" ;;        # if no server file, assume this is it
  786. !     *)    me="` hostname `"    ;;
  787. !     esac
  788. !     case "$me" in
  789. !     $server) args= ;;
  790. !     *)    args="`
  791. !             (echo PATH=$PATH
  792. !              echo 'echo -p $$ -t'
  793. !              echo now) |
  794. !                 ersh $server /bin/sh
  795. !         `" ;;
  796. !     esac
  797.   
  798.       # POLICY: msgid format; usg gcos?
  799.       # tailor: add -u for USG GCOS fields
  800. --- 39,56 ----
  801.   if tear $prefix &&    # output in $inhdrs and $inbody ** takes 0.4 seconds
  802.       canonhdr -dm <$inhdrs >$hdrs    # dredge up defaults ** takes 0.1 secs
  803.   then
  804. !     # are we a client of a server?
  805. !     if test -r $NEWSCTL/server
  806. !     then
  807. !         svr="`cat $NEWSCTL/server`"
  808. !         me="`hostname`"
  809. !         case "$me" in
  810. !         $svr)    args=                ;;
  811. !         *)    args="-c $me -s $server"    ;;
  812. !         esac
  813. !     else
  814. !         args=
  815. !     fi
  816.   
  817.       # POLICY: msgid format; usg gcos?
  818.       # tailor: add -u for USG GCOS fields
  819.  
  820.  
  821.  
  822. *** input/makefile.mastercopy    Mon Jan  2 16:31:28 1995
  823. --- input/makefile    Wed Dec 28 22:05:54 1994
  824. ***************
  825. *** 118,124 ****
  826.       echo 'echo "$$*" ; cat >&2' >bin/report
  827.       echo ':' >bin/domkov
  828.       mkdir decompressors
  829. !     echo 'sed 1d $$*' >decompressors/dejunk
  830.       $(MX) bin/* decompressors/*
  831.       mkdir arts arts/in.coming ;        # but not bad, yet
  832.   
  833. --- 118,124 ----
  834.       echo 'echo "$$*" ; cat >&2' >bin/report
  835.       echo ':' >bin/domkov
  836.       mkdir decompressors
  837. !     echo 'sed 1d' >decompressors/dejunk
  838.       $(MX) bin/* decompressors/*
  839.       mkdir arts arts/in.coming ;        # but not bad, yet
  840.   
  841.  
  842.  
  843.  
  844. *** libdbz/makefile.mastercopy    Mon Jan  2 16:31:29 1995
  845. --- libdbz/makefile    Tue Dec 13 23:36:24 1994
  846. ***************
  847. *** 37,43 ****
  848.   lint:
  849.       lint $(LINTFLAGS) dbzmain.c dbz.c dbzdbm.c
  850.   
  851. ! rdbz tdbz fake byteflip:    $(LIBS)
  852.   
  853.   rdbz.o:    dbz.c
  854.       cp dbz.c rdbz.c
  855. --- 37,43 ----
  856.   lint:
  857.       lint $(LINTFLAGS) dbzmain.c dbz.c dbzdbm.c
  858.   
  859. ! rdbz tdbz fake byteflip:    $(LIB)
  860.   
  861.   rdbz.o:    dbz.c
  862.       cp dbz.c rdbz.c
  863.  
  864.  
  865.  
  866. *** maint/histinfo.c.mastercopy    Mon Jan  2 16:31:29 1995
  867. --- maint/histinfo.c    Mon Dec 19 00:46:07 1994
  868. ***************
  869. *** 6,11 ****
  870. --- 6,13 ----
  871.   #include <sys/types.h>
  872.   #include <sys/stat.h>        /* for modified time (date received) */
  873.   #include <string.h>
  874. + #include <errno.h>
  875. + #include "fixerrno.h"
  876.   #include "config.h"
  877.   #include "fgetfln.h"
  878.   #include "alloc.h"
  879. ***************
  880. *** 16,22 ****
  881.   char *progname;
  882.   int debug;
  883.   
  884. - FILE *efopen();
  885.   
  886.   char *spdir;
  887.   int spdirlen;
  888. --- 18,23 ----
  889. ***************
  890. *** 56,64 ****
  891.       
  892.       while ((inname = fgetline(stdin, (size_t *)NULL)) != NULL)
  893.           if (strchr(inname, '.') == NULL) {    /* skip dot names */
  894. !             in = efopen(inname, "r");
  895. !             process(in, inname);
  896. !             (void) fclose(in);
  897.           }
  898.       exit(0);
  899.   }
  900. --- 57,70 ----
  901.       
  902.       while ((inname = fgetline(stdin, (size_t *)NULL)) != NULL)
  903.           if (strchr(inname, '.') == NULL) {    /* skip dot names */
  904. !             errno = 0;
  905. !             in = fopen(inname, "r");
  906. !             if (in == NULL && errno != ENOENT)
  907. !                 error("cannot open file `%s'", inname);
  908. !             if (in != NULL) {
  909. !                 process(in, inname);
  910. !                 (void) fclose(in);
  911. !             }
  912.           }
  913.       exit(0);
  914.   }
  915.  
  916.  
  917.  
  918. *** maint/makefile.mastercopy    Mon Jan  2 16:31:30 1995
  919. --- maint/makefile    Sun Jan  1 18:34:23 1995
  920. ***************
  921. *** 28,34 ****
  922.   setup:
  923.   
  924.   cmp:    $(ALL)
  925. !     @$(IN) $(DEST) $(DPROGS)
  926.       @$(IN) $(UIBIN) $(UI)
  927.       $(DEST)/checkactive -q
  928.   
  929. --- 28,35 ----
  930.   setup:
  931.   
  932.   cmp:    $(ALL)
  933. !     @$(IN) $(DEST) $(NORMAL)
  934. !     @$(IN) -i $(DEST) $(CUSTOM)
  935.       @$(IN) $(UIBIN) $(UI)
  936.       $(DEST)/checkactive -q
  937.   
  938.  
  939.  
  940.  
  941. *** man/newsflag.8cn.mastercopy    Mon Jan  2 16:31:31 1995
  942. --- man/newsflag.8cn    Tue Dec 13 13:47:17 1994
  943. ***************
  944. *** 0 ****
  945. --- 1,46 ----
  946. + .\" =()<.ds a @<NEWSARTS>@>()=
  947. + .ds a /var/news
  948. + .\" =()<.ds b @<NEWSBIN>@>()=
  949. + .ds b /usr/libexec/news
  950. + .\" =()<.ds c @<NEWSCTL>@>()=
  951. + .ds c /etc/news
  952. + .\"
  953. + .\"
  954. + .\"
  955. + .TH NEWSFLAG 8CN "13 Dec 1994"
  956. + .BY "C News"
  957. + .SH NAME
  958. + newsflag \- change active-file flag for newsgroup
  959. + .SH SYNOPSIS
  960. + .B \*b/maint/newsflag
  961. + newsgroup
  962. + newval
  963. + .SH DESCRIPTION
  964. + .I Newsflag
  965. + sets the fourth field of
  966. + .IR newsgroup 's
  967. + entry in the
  968. + .I active
  969. + file (see
  970. + .IR newsdb (5))
  971. + to
  972. + .IR newval ,
  973. + doing proper locking to ensure safe modification of the file.
  974. + For example, to change newsgroup
  975. + .I x.y.z
  976. + from unmoderated to moderated:
  977. + .PP
  978. + .RS
  979. + .nf
  980. + newsflag x.y.z m
  981. + .fi
  982. + .RE
  983. + .PP
  984. + The effect is purely local; no control message (to propagate the
  985. + change to other machines) is sent.
  986. + .SH FILES
  987. + \*c/active
  988. + .SH SEE ALSO
  989. + newsdb(5)
  990. + .SH HISTORY
  991. + Written by Henry Spencer for C News.
  992.  
  993.  
  994.  
  995. *** nov/expovguts.c.mastercopy    Mon Jan  2 16:31:31 1995
  996. --- nov/expovguts.c    Wed Dec 28 18:06:05 1994
  997. ***************
  998. *** 60,68 ****
  999.   
  1000.       start = atol(argv[optind+1]);
  1001.       stop = atol(argv[optind]);        /* tentatively */
  1002. !     if (start > stop+1 || start == 0) {
  1003. !         fprintf(stderr, "%s: min (%s) is 0 or exceeds max (%s) + 1\n",
  1004. !                 progname, argv[optind+1], argv[optind]);
  1005.           exit(2);
  1006.       }
  1007.       stop += 100;                /* a bit of headroom */
  1008. --- 60,75 ----
  1009.   
  1010.       start = atol(argv[optind+1]);
  1011.       stop = atol(argv[optind]);        /* tentatively */
  1012. !     if (start == 0) {
  1013. !         fprintf(stderr, "%s: in expiring `%s',\n", progname, inname);
  1014. !         fprintf(stderr, "\tfound problem in active file:  min == 0\n",
  1015. !                             argv[optind+1]);
  1016. !         exit(2);
  1017. !     }
  1018. !     if (start > stop+1) {
  1019. !         fprintf(stderr, "%s: in expiring `%s',\n", progname, inname);
  1020. !         fprintf(stderr, "\tfound problem in active file:  min (%s) > max (%s) + 1\n",
  1021. !                     argv[optind+1], argv[optind]);
  1022.           exit(2);
  1023.       }
  1024.       stop += 100;                /* a bit of headroom */
  1025. ***************
  1026. *** 126,134 ****
  1027.       }
  1028.   
  1029.       if (nbad > 0) {
  1030. !         fprintf(stderr, "%s: in expiring `%s',\n", progname, inname);
  1031. !         fprintf(stderr, "\tfound %d files with numbers < min (%ld)\n",
  1032.                                   nbad, start);
  1033.       }
  1034.   }
  1035.   
  1036. --- 133,143 ----
  1037.       }
  1038.   
  1039.       if (nbad > 0) {
  1040. !         fprintf(stderr, "%s: (warning) in expiring `%s',\n", progname,
  1041. !                                 inname);
  1042. !         fprintf(stderr, "\tfound %d files with numbers < min (%ld),\n",
  1043.                                   nbad, start);
  1044. +         fprintf(stderr, "\tindicating problems with upact\n");
  1045.       }
  1046.   }
  1047.   
  1048.  
  1049.  
  1050.  
  1051. *** nov/expov.mastercopy    Mon Jan  2 16:31:32 1995
  1052. --- nov/expov    Wed Dec 28 18:09:00 1994
  1053. ***************
  1054. *** 46,53 ****
  1055.               echo "    ...using fallback code" >&2
  1056.   
  1057.               # fallback
  1058. !             # could use one less temporary if certain systems
  1059. !             # didn't have buggy implementations of sort -o
  1060.               sort $o/.overview >$o/.sov
  1061.               ls | egrep '^[0-9]+$' | join -t'    ' - $o/.sov |
  1062.                               sort -n >$o/.nov
  1063. --- 46,53 ----
  1064.               echo "    ...using fallback code" >&2
  1065.   
  1066.               # fallback
  1067. !             # could use one less temporary if GNU sort didn't
  1068. !             # have bugs in -o
  1069.               sort $o/.overview >$o/.sov
  1070.               ls | egrep '^[0-9]+$' | join -t'    ' - $o/.sov |
  1071.                               sort -n >$o/.nov
  1072.  
  1073.  
  1074.  
  1075. *** util/dostatfs.c.mastercopy    Mon Jan  2 16:31:32 1995
  1076. --- util/dostatfs.c    Mon Jan  2 16:07:09 1995
  1077. ***************
  1078. *** 17,35 ****
  1079.   #include <sys/mount.h>
  1080.   
  1081.   /* Second, assorted variations... */
  1082. ! #ifdef BSD4_4
  1083. ! #define    UNIT    f_bsize
  1084.   #endif
  1085.   #ifdef sun
  1086.   #include <sys/vfs.h>
  1087.   #define    UNIT    f_bsize
  1088.   #endif
  1089.   #ifdef _AIX
  1090.   #include <sys/statfs.h>
  1091.   #endif
  1092.   #ifdef M_XENIX        /* SCO */
  1093.   #include <sys/statfs.h>
  1094.   #define    STATFS(fs, result)    statfs(fs, &result, (int)sizeof(result), 0)
  1095.   #endif
  1096.   
  1097.   /* Finally, some defaults to simplify the above. */
  1098. --- 17,55 ----
  1099.   #include <sys/mount.h>
  1100.   
  1101.   /* Second, assorted variations... */
  1102. ! #ifdef linux
  1103. ! #define    sun    1    /* Linux happens to be the same as Sun for this... */
  1104. ! #else
  1105. ! #ifdef __linux__
  1106. ! #define    sun    1    /* a Linux by any other name... */
  1107. ! #endif
  1108. ! #endif
  1109. ! #ifdef hpux
  1110. ! #define    sun    1    /* likewise HP */
  1111.   #endif
  1112. + #ifdef __FreeBSD__
  1113. + #define    BSD4_4    1    /* and FreeBSD is sort of 4.4 */
  1114. + #endif
  1115.   #ifdef sun
  1116.   #include <sys/vfs.h>
  1117.   #define    UNIT    f_bsize
  1118.   #endif
  1119.   #ifdef _AIX
  1120.   #include <sys/statfs.h>
  1121. + #define    UNIT    f_fsize
  1122.   #endif
  1123.   #ifdef M_XENIX        /* SCO */
  1124.   #include <sys/statfs.h>
  1125.   #define    STATFS(fs, result)    statfs(fs, &result, (int)sizeof(result), 0)
  1126. + #define    UNIT    f_fsize
  1127. + #define    f_bavail    f_bfree    /* talk about kludges */
  1128. + #endif
  1129. + #ifdef BSD4_4
  1130. + #define    UNIT    f_bsize
  1131.   #endif
  1132.   
  1133.   /* Finally, some defaults to simplify the above. */
  1134.  
  1135.  
  1136.  
  1137.